package org.example.project.bookstore.controller;

import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import org.example.bean.Order;
import org.example.project.bookstore.service.OrderService;
import org.example.util.JsonResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther:Liu
 * @Testname:OrderController
 * @Date:2025/8/26 09:55
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Resource
    private OrderService orderService;

    @PostMapping("/save")
    public JsonResult saveOrder(@RequestBody Order order, HttpServletRequest request) {
        return orderService.saveOrrder(order, request);
    }
}
